<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>学生表</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  <script type="text/javascript">
  //编写自定义JS代码
  </script>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="studentController.do?doAdd" 
  				tiptype="3" beforeSubmit="validateStu" >
  				
					<input id="id" name="id" type="hidden" value="${studentPage.id }">
					<input id="createName" name="createName" type="hidden" value="${studentPage.createName }">
					<input id="createBy" name="createBy" type="hidden" value="${studentPage.createBy }">
					<input id="createDate" name="createDate" type="hidden" value="${studentPage.createDate }">
					<input id="updateName" name="updateName" type="hidden" value="${studentPage.updateName }">
					<input id="updateBy" name="updateBy" type="hidden" value="${studentPage.updateBy }">
					<input id="updateDate" name="updateDate" type="hidden" value="${studentPage.updateDate }">
		<table style="width: 100%;" cellpadding="0" cellspacing="1" class="formtable">
				<tr>
					<td align="right">
						<label class="Validform_label">
							学号:
						</label>
					</td>
					<td class="value">
					     <input id="stuNo" name="stuNo" type="text" style="width: 150px" class="inputxt"  datatype="*"
					     	nullmsg="请输入学号！"  onkeypress="specialTextValidate()" 
					     	>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">学号</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							姓名:
						</label>
					</td>
					<td class="value">
					     	 <input id="stuName" name="stuName" type="text" style="width: 150px" maxlength="80"
					     	 class="inputxt"  datatype="*" onkeypress="specialTextValidate()">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">姓名</label>
						</td>
					</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							性别:
						</label>
					</td>
					<td class="value">
							  <t:dictSelect field="sex" type="radio"
									typeGroupCode="sex" defaultVal="${studentPage.sex}" hasLabel="false"  title="性别"></t:dictSelect>     
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">性别</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							生日:
						</label>
					</td>
					<td class="value">
					     	<input id="birthday" name="birthday" type="text" style="width: 150px" class="inputxt" onClick="WdatePicker()">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">生日</label>
						</td>
					</tr>
				 
				<tr>
					<td align="right">
						<label class="Validform_label">
							专业:
						</label>
					</td>
					<td class="value"> 
                	     <input id="majorId" name="majorId" type="hidden"  >               
					     <input id="majorName" name="majorName" type="text" 
					     style="width: 150px" class="inputxt" readonly="readonly" datatype="*" nullmsg="请选择专业">
					     <t:choose hiddenName="majorId" hiddenid="id" url="dictMajorController.do?goSelect" name="majorList"
                          icon="icon-search" title="选择专业" textname="majorName" isclear="false" isInit="true"></t:choose>
							
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">专业</label> 
					</td>
					<td align="right">
						<label class="Validform_label">
							系别:
						</label>
					</td>
					<td class="value">
 					     <input id="seriesId" name="seriesId" type="hidden"  >               
					     <input id="seriesName"  type="text" style="width: 150px"
					      class="inputxt" readonly="readonly" datatype="*" nullmsg="请选择系别">
					     <t:choose hiddenName="seriesId" hiddenid="id" url="dictSeriesController.do?goSelect" name="seriesList"
                          icon="icon-search" title="选择系别" textname="seriesName" isclear="false" isInit="true"></t:choose>
							
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">系别</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							班级:
						</label>
					</td>
					<td class="value">
					     	
					     <input id="gradeId" name="gradeId" type="hidden">               
					     <input id="className"  type="text" style="width: 150px" class="inputxt" 
					      readonly="readonly" datatype="*"  >
					     <t:choose hiddenName="gradeId" hiddenid="id" url="dictGradeController.do?goSelect" name="deviceGradeList"
                          icon="icon-search" title="选择" textname="className" isclear="false" isInit="true"  ></t:choose>
					     	
					     	
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">班级</label>
					</td>
				 
					<td align="right">
						<label class="Validform_label">
							组别:
						</label>
					</td>
					<td class="value">
  					     <input id="groupId" name="groupId" type="hidden"  >               
					     <input id=groupName  type="text"  style="width: 150px" class="inputxt"
					      readonly="readonly" datatype="*" nullmsg="请选择组别">
					     <t:choose hiddenName="groupId" hiddenid="id" url="dictGroupController.do?goSelect" name="groupList"
                          icon="icon-search" title="选择组别" textname="groupName" isclear="false" isInit="true"></t:choose>
							  
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">组别</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							系内外:
						</label>
					</td>
					<td class="value">
							  <t:dictSelect field="seriesType" type="radio"
									typeGroupCode="seriesType" defaultVal="${studentPage.seriesType}" hasLabel="false"  title="系内外"></t:dictSelect>     
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">系内外</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							一卡通:
						</label>
					</td>
					<td class="value">
					     	 <input id="cardNo" name="cardNo" type="text" style="width: 150px" class="inputxt" >
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">一卡通</label>
						</td>
					</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							手机号:
						</label>
					</td>
					<td class="value">
					     	<input onkeyup="this.value=this.value.replace(/\D/g,'')" id="cellphone" name="cellphone" type="text" maxlength="11" style="width: 150px" class="inputxt" 
					     	datatype="m"
					     	>
							<span class="Validform_checktip">手机号为11位数字</span>
							<label class="Validform_label" style="display: none;">手机号</label>
						</td>
				<td align="right">
					<label class="Validform_label">
					</label>
				</td>
				<td class="value">
				</td>
					</tr>
			</table>
		</t:formvalid>
 </body>
 <script type="text/javascript">
 	$(document).ready(function(){
 		$("#birthday").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});

 	}); 
 	
 	function validateStu(){
 		var stuNo = $('#stuNo').val();
 		var result;
 		$.ajax({
 			url:'studentController/validateStuNo.do?no='+stuNo,
 			datatype:'json',
 			async:false,
 			success:function(data){
				data = $.parseJSON(data); 
 				if(!data.success){
 					tip(data.msg);
 					result =  false;
 				}else{
 					result =  true;
 				}
 			}
 		});
 		
 		return result;
 	}
 	
 </script>
  <script src = "webpage/com/mengtian_tech/device_mgr/student/student.js"></script>		
